<script type="text/javascript" language="javascript">
    function getCurrentDateTime() {   
        var now = new Date().toString().split(" ");

        var dayDate = now[0];
	    var month = now[1];
	    var day = now[2];
	    
        if (now.length == 6) {
	        var year = now[5];
	        var time = now[3];
        }
        else {
        	var year = now[3];
	        var time = now[4];
        }
        return day + "&nbsp;" + month + " " + year + ", " + time;
    }

    function setDateTime() {
        var currentDateTime = getCurrentDateTime();
        document.getElementById("time").innerHTML = currentDateTime;
    }
	function popupWindow(pageURL, title,w,h) {
        var left = (screen.width/2)-(w/2);
        var top = (screen.height/2)-(h/2);
        var targetWin = window.open (pageURL, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width='+w+', height='+h+', top='+top+', left='+left);
}
</script>


<!-- display dynamic date and time -->
<script type="text/javascript" language="javascript">
    setInterval("setDateTime()", 100);
</script>	

<div id="logo_user">
    <div id="logo">
		<h1><a href="#">TestSmart</a></h1>
		<p> Designed by <a href="mailto:NPT.SGP.MOBILE_TEST@jdsu.com">SART Test Team</a></p>
	</div>
	<div id="user">
        <div id="time">
	    </div>
    
	    <?php
		    if (isset($_SESSION['uid'])) {
			    $login_user = substr($_SESSION['uname'], 0, strpos($_SESSION['uid'], '@'));
				if ($login_user == "") {
				    $login_user = $_SESSION['uname'];
				}
	            //echo "Welcome&nbsp;&nbsp;<a href=\"\" onclick=\"javascript: popupWindow('common/user/user_profile_page.php', 'Change Password', '300', '200');\"><u>{$login_user}</u></a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href=\"common/user/logout.php\">Sign out</a></p>";
	            echo "Welcome&nbsp;&nbsp;<a href=\"javascript:dynamicDiv('content', 'common/user/user_profile_page.php')\"><u>{$login_user}</u></a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href=\"common/user/logout.php\">Sign out</a></p>";
			}
			else {
			    echo "<a href=\"login.php\">Sign in</a></p>";
			}
	    ?>
    </div>	
</div>